{% extends "base.volt" %}

{% block pageFooter%}
    {{ javascript_include("/assets/manage/js/bp/bannerBp.js", false) }}
{% endblock %}

{% block content %}
    {{ partial("module/left_bp") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>美容院</li>
            <li>Banner位管理</li>
            <li class="active">首页美容院推荐</li>
        </ol>

        <div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" role="form" action="" method="get">
                <div class="input-group">
                    <a class="btn btn-primary" href="{{ url.get('bp/bannerBpAdd') }}">添加推荐美容院</a>
                </div>
                        <div class="pull-right">
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon">城市</label>
                            <select class="form-control" name="City" id="filterCity">
                                {% if filterCity == 0 %}
                                <option value="0" {{ filterCity == 0 ? 'selected="selected"' : '' }} >请选择</option>
                                {% endif %}
                                {% for oc in openCity %}
                                    <option value="{{ oc.city_id }}" {{ filterCity == oc.city_id ? 'selected="selected"' : '' }} >{{ oc.city_name|e }}</option>
                                {% endfor %}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 查 询</button>
                    </div>
        </div>
                </form>
            </div>
        </div>

        {% if filterCity > 0 %}
        <table class="table table-hover edit_edit">
            <thead>
            <tr>
                <th style="">ID</th>
                <th>美容院ID</th>
                <th>美容院图片</th>
                <th style="">城市</th>
                <th style="">位置</th>
                <th >开始时间</th>
                <th >结束时间</th>
                <th style="">操作</th>
            </tr>
            </thead>
            <?php foreach($list as $r){?>
                <tr>
                    <td><?=$r['id']?></td>
                    <td><?=$r['bp_id']?></td>
                    <td><img style="width:50px;height:50px;" src="<?=$r['img_url']?>"/></td>
                    <td><?=$r['city_name']?></td>
                    <td><?=$r['sort']?></td>
                    <td>{{ r['show_start_time'] }}</td>
                    <td>{{ r['show_end_time'] }}</td>
                    <td><a class="btn btn-default calloff" id="calloff"  durl="{{url.get('bp/calloff')}}?id=<?=$r['id']?>&city_id=<?=$_GET['City']?>" href="javascript:void(0);">取消推荐</a></td>
                </tr>
            <?php }?>
        </table>
		{{ this.tagNav.page(
        page,
        total,
        limit,
        url.get('bp/list', [
            'filterName': filterName,
            'filterProvince': filterProvince,
            'filterCity': filterCity,
            'filterDistrict': filterDistrict,
            'filterState': filterState,
            'filterSell': filterSell,
            'filterMedal': filterMedal,
            'page': '__PAGE__'
        ]
    )) }}

        {% endif %}
    </div>
{% endblock %}